var App = (App == undefined) ? {} : App;

(function( $, App ) {
    
    App.TestWidget = function(settings) {
         return $.jsa.extend({
            name : 'TestWidget',
            HTML_PARSER : {
              wrapper : 'div.wrapper',
              subject : 'p.subject'
            },
            init : function() {
                this.node.boundingBox.addClass('init');
            },
            syncUI : function() {
                this.node.boundingBox.addClass('syncUI');
            },
            renderUI : function() {
                this.node.boundingBox.addClass('renderUI');

                if (this.node.wrapper.length) {
                    this.node.boundingBox.addClass('wrapperFound');
                }
                if (this.node.subject.length) {
                    this.node.boundingBox.addClass('subjectFound');
                }

            }
          }, $.jsa.WidgetAbstract, settings);
     };

     App.TestExtention = $.jsa.extend({
         name : 'TestExtention',
         additionalAttribute : "extAttr",
         initStatus : "",
         extMethod : function() {
              this.node.boundingBox.addClass('extMethod');
         },
         init : function() {
             this.initStatus = 'extInit';
         }         
     }, $.jsa.WidgetAbstract);

     App.TestExtended = function(settings) {
         return $.jsa.extend({
            name : 'TestExtended',
            init : function() {
                this.node.boundingBox.addClass('init');
                this.node.boundingBox.addClass(this.additionalAttribute);
                this.node.boundingBox.addClass(this.initStatus);
                this.extMethod();
            }
          }, App.TestExtention, settings);
     };

 })( jQuery, App );
